package basicprocess.authentication.tablename;

import java.util.Hashtable;
import java.util.Vector;
import database.RecordSearch;
import dbmanager.GetIdName;
import utility.Input;



public class Property_details implements Authentication 
{	
	basicprocess.authentication.Condition conditionobject;
	RecordSearch sr;
	GetIdName gid;
	
	public void getResult() 
	{
		try 
		{
			String Masterid = conditionobject.authentication.pool.getHashtabel().get("id").toString();
			gid= new GetIdName(conditionobject.database);
			//Masterid = gid.getId(Masterid);
			sr =new RecordSearch(conditionobject.database);
			Hashtable<Object, Object> table =new Hashtable<Object, Object>();
			table.put("mid", Masterid);
			table.put("td", "null");
			sr.setConditionMap(table);
			Vector<Object> property =sr.getVectorFromResultSet();
			for(int i=0;i<property.size();i++)
			{
				pool.tablename.Property_details pd= new pool.tablename.Property_details();
				pd.PropertyMap.putAll((Hashtable<Object, Object>)property.get(i));
				conditionobject.property.add(pd);
			}
		}
		catch (Exception e) 
		{
			e.printStackTrace();
			try
			{
				Vector< Object> property=new Vector<Object>();
				property.addAll(conditionobject.authentication.pool.getpropertyVector());
				for(int i=0;i<property.size();i++)
				{	
					conditionobject.property.add(property.get(i));
				}
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}
	}

	public void setObject(Object object)
	{
		conditionobject = (basicprocess.authentication.Condition ) object;
		
	}

}
